package com.mybatisplus.multidatasource.member.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.util.Date;

/**
 * @Author: J.K
 * @Date: 2021-09-18 17:01
 * @Description:
 */
@Data
@TableName("mybatis_plus_user")
public class UserEntity {
    /**
     * 设置主键自增（即便是数据表中设置了自增，不加注解依然会报错）
     * PS: IdType.AUTO自增适用于单数据库，分布式集群适合IdType.ASSIN_ID
     */
    @TableId(value = "user_id", type = IdType.AUTO)
    private Long userId;
    private String userName;
    private Integer userAge;
    private String userAddress;
    private Date createTime;

    @TableLogic
    private Integer deleted = 0;
}
